package com.costmary.spper.util;

/**
 * Created by IntelliJ IDEA.
 * User: sen
 * Date: 2010-9-18
 * Time: 23:18:26
 * To change this template use File | Settings | File Templates.
 */

import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;

import org.apache.log4j.Logger;

public class YahooRetriever {
    private static Logger log = Logger.getLogger(YahooRetriever.class);

    public InputStream retrieve(int zipcode) throws Exception {
        log.info("Retrieving Weather Data");
        String url = "http://weather.yahooapis.com/forecastrss?p=" + zipcode;
        URLConnection conn = new URL(url).openConnection();
        return conn.getInputStream();
    }
}